package com.icorp.istaff.dao.impl;

import javax.annotation.Resource;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.icorp.istaff.dao.declaration.ILoginDao;
import com.icorp.istaff.entity.User;

@Repository("LoginDao")  
public class LoginDaoImpl implements ILoginDao {
	@Resource(name="sessionFactory")
	private SessionFactory session;

	@Override
	public boolean login() {
		User user = new User();
		user.setName("chuck");
		int retId = (Integer) session.getCurrentSession().save(user);
		return true;
	}

	public SessionFactory getSession() {
		return session;
	}

	public void setSession(SessionFactory session) {
		this.session = session;
	}

}
